package homework;

import java.util.Scanner;

public class test4_try2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //总工资
        System.out.print("请输入工资：");
        int wages = scan.nextInt();
        //扣除三险一金后应该纳税的工资
        double before = wages * 0.9 - 5000;
        //定义所要交的税
        double shui = 0;
        if (before >= 0 && before < 3000) {
            shui = before * 0.03;
        } else if (before >= 3000 && before < 12000) {
            shui = 3000 * 0.03 + (before - 3000) * 0.1;
        } else if (before >= 12000 && before < 25000) {
            shui = 3000 * 0.03 + 9000 * 0.1 + (before - 12000) * 0.2;
        } else if (before >= 25000 && before < 35000) {
            shui = 3000 * 0.03 + 9000 * 0.1 + 13000 * 0.2 + (before - 25000) * 0.25;
        } else if (before >= 35000 && before < 55000) {
            shui = 3000 * 0.03 + 9000 * 0.1 + 13000 * 0.2 + 10000 * 0.25 + (before - 35000) * 0.3;
        } else if (before >= 55000 && before < 80000) {
            shui = 3000 * 0.03 + 9000 * 0.1 + 13000 * 0.2 + 10000 * 0.25 + 20000 * 0.3 + (before - 55000) * 0.35;
        } else if (before >= 80000) {
            shui = 3000 * 0.03 + 9000 * 0.1 + 13000 * 0.2 + 10000 * 0.25 + 20000 * 0.3 + 25000 * 0.35 + (before - 80000) * 0.45;
        }else{
            shui = 0;
        }
        System.out.println("所需纳税总额：" + shui + "元");
        double after = wages*0.9 - shui;
        System.out.println("税后工资为：" + after + "元");
    }

}
